//
//  HomeProvider.swift
//  TODOApp
//
//  Created by chenyh on 2018/5/25.
//  Copyright © 2018年 chenyh. All rights reserved.
//

struct HomeProvider {
    private let pageSize = 10
    func getTodoList(pageIndex: Int,complement: @escaping ([HomeModel]) -> Void ) {
        NetLayerRequestSender()
            .send(ApiRequestManager.getTodoList(pageIndex: pageIndex, pageSize: pageSize)) { baseModel,error  in
            
            if error != nil {
                complement([])
            }else if baseModel!.status == 1,
                let dicts = baseModel!.result as? [[String: Any]] {
                print(dicts)
                complement([])
            }
        }
    }
}

